package com.wxg.junit.appendix.B3;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.*;
import static com.wxg.junit.appendix.B3.IsNotNullOrEmpty.*;

import org.junit.Test;

public class TestStringIsNullUsingMatcher {

    /**
     * {@link Assert}
     * {@link IsNotNullOrEmpty}
     */
    @Test(expected = java.lang.AssertionError.class)
    public void testIsNotNullOrEmptyButIsNull() {
        String str = null;

        assertThat(str, isNotNullOrEmpty());
        assertThat(str, is(notNullOrEmpty()));
    }

    @Test(expected = java.lang.AssertionError.class)
    public void testIsNotNullOrEmptyButIsEmpty() {
        String str = "";

        assertThat(str, isNotNullOrEmpty());
        assertThat(str, is(notNullOrEmpty()));
    }

    @Test
    public void testIsNotNullOrEmptyIsNotNull() {
        String str = "test";

        assertThat(str, isNotNullOrEmpty());
        assertThat(str, is(notNullOrEmpty()));
    }
}
